import request from '@/utils/request'

// 查询部门列表
export function listDept(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}


// 查询部门列表
export function listDeptAll(query) {
  return request({
    url: '/system/dept/listAll',
    method: 'get',
    params: query
  })
}
// 查询部门列表
export function listDeptByEnterpriseInfo(query) {
  return request({
    url: '/system/dept/listByEnterpriseInfo',
    method: 'get',
    params: query
  })
}
//查询企业认证审核列表
export function listByIsCertified(query) {
  return request({
    url: '/system/dept/listByIsCertified',
    method: 'get',
    params: query
  })
}
// 查询部门详细
export function getDeptByDeptName(deptName) {
  return request({
    url: '/system/dept/getName/' + deptName,
    method: 'get'
  })
}
export function getDeptInfoByDeptName(deptName) {
  return request({
    url: '/system/dept/getDeptName/' + deptName,
    method: 'get'
  })
}
export function listDeptTwo(query) {
  return request({
    url: '/system/dept/deptList',
    method: 'get',
    params: query
  })
}

export function listDeptType(query) {
  return request({
    url: '/system/dept/deptListType',
    method: 'get',
    params: query
  })
}

// 查询部门类型数量 用于首页展示
export function listDeptIndex(query) {
  return request({
    url: '/system/dept/selectDeptListIndex',
    method: 'get',
    params: query
  })
}

// 查询部门类型数量 用于首页展示
export function listDeptIndexCount(query) {
  return request({
    url: '/system/dept/selectDeptListIndexCount',
    method: 'get',
    params: query
  })
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: '/system/dept/list/exclude/' + deptId,
    method: 'get'
  })
}

// 查询部门详细
export function getDept(deptId) {
  return request({
    url: '/system/dept/' + deptId,
    method: 'get'
  })
}

// 新增部门
export function addDept(data) {
  return request({
    url: '/system/dept',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDept(data) {
  return request({
    url: '/system/dept',
    method: 'put',
    data: data
  })
}

export function enterpriseVerify(data) {
  return request({
    url: '/system/dept/enterpriseVerify',
    method: 'post',
    data: data
  })
}

// 删除部门
export function delDept(deptId) {
  return request({
    url: '/system/dept/' + deptId,
    method: 'delete'
  })
}
// 字典左侧树
export function getDictDept() {
  return request({
    url: '/system/dept/getDictDept',
    method: 'get'
  })
}

export function getOrgList(query) {
  return request({
    url: '/system/dept/orgList',
    method: 'get',
    params: query
  })
}

export function getOrgListAll(query) {
  return request({
  url:'/system/dept/orgListAll',
    method:'get',
  params:query
})
}


